#pragma once


inline NTSTATUS CompleteIrp(PIRP Irp, NTSTATUS status, ULONG info)
{
	Irp->IoStatus.Status = status;
	Irp->IoStatus.Information = info;
	IoCompleteRequest(Irp, IO_NO_INCREMENT);
	return status;
}








//---------------functions prototypes declaration---------------

//reading-writing procedures
extern "C" NTSTATUS VCRYDReadWriteDispatch(PDEVICE_OBJECT pDeviceObject, PIRP Irp);
//Other thread procedures
extern "C" NTSTATUS VCRYDCreate(IN PDEVICE_OBJECT gDeviceObject, IN PIRP Irp);
extern "C" NTSTATUS VCRYDControl(IN PDEVICE_OBJECT gDeviceObject, IN PIRP Irp);
//Driver unload_routine
extern "C" DRIVER_UNLOAD VCRYDUnload;
//Thread function
extern "C" NTSTATUS VCRYDcreateThread(PDEVICE_OBJECT pDeviceObject);
VOID VCRYDThread(PVOID context);
//mount dismount routines
extern "C" NTSTATUS VCRYDdismountVirtualDisk(PDEVICE_OBJECT);
//p'n'p controls passing down to driver stack
extern "C" DRIVER_DISPATCH VCRYDDispatchSystemControl;
//addDeviceRoutine
extern "C" DRIVER_ADD_DEVICE VCRYDAddDevice;
extern "C" NTSTATUS VCRYDAddDevice(__in struct _DRIVER_OBJECT  *DriverObject, __in struct _DEVICE_OBJECT  *PhysicalDeviceObject);
// open and close file to work with
extern "C" NTSTATUS VCRYDOpenImageFile(IN PDEVICE_OBJECT pDeviceObject, IN PIRP Irp);
extern "C" NTSTATUS VCRYDCloseImageFile(IN PDEVICE_OBJECT pDeviceObject);
// crypting and decrypting
extern "C" NTSTATUS Crypt(PVOID text, PUCHAR key, ULONG length);
extern "C" NTSTATUS DeCrypt(PVOID text, PUCHAR key, ULONG length);

//extern "C" NTSTATUS Crypt(IN PDEVICE_OBJECT pDeviceObject, IN PIRP Irp);
//extern "C" NTSTATUS DeCrypt(IN PDEVICE_OBJECT pDeviceObject, IN PIRP Irp);
//---------------End of functions prototypes declaration---------------